#include<iostream.h> 

int main() 
{
	int m,n,i,k,f;
	int caseN = 0;

	while(cin>>n>>m)
	{ 		
		if(!n&&!m)
			break; 		
		caseN++; 		
		for(i=n,k=m;;)
		{
			if(k>i*(i-1)/2||i<=0) 
			{
				cout << "Case " << caseN << ": " << n << " lines cannot make exactly " << m << " crossings." <<endl;
				break;
 			} 
			if(k==0)
			{ 
                cout << "Case " << caseN << ": " << n << " lines with exactly " << m << " crossings can cut the plane into " << m+n+1 << " pieces at most." <<endl;
				break;
 			}
			for(f=1;f<=i&&k<=f*(i-f)+(i-f)*(i-f-1)/2;f++);
			i-=f-1;
			k-=((f-1)*i);
			continue;
 		}
 	}
 }  

